//
//  NewsViewCell.m
//  Finance
//
//  Created by cheng xiang on 13-6-30.
//  Copyright (c) 2013年 cheng xiang. All rights reserved.
//

#import "NewsViewCell.h"

@implementation NewsViewCell

@synthesize newsIdLabel = _newsIdLabel, titleLabel = _titleLabel, keywordsLabel = _keywordsLabel, summaryLabel = _summaryLabel, posttimeLabel = _posttimeLabel, readCountLabel = _readCountLabel,postUserLabel = _postUserLabel, postUserNameLabel = _postUserNameLabel,cateIdLabel = _cateIdLabel,cateNameLabel = _cateNameLabel, authorLabel = _authorLabel, sourceLabel = _sourceLabel;

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        CGSize winsize = self.frame.size;
        // Initialization code
//        _newsIdLabel = [[UILabel alloc] initWithFrame:CGRectMake(5, 0, 150, 20)];
//        _keywordsLabel = [[UILabel alloc] initWithFrame:CGRectMake(160, 0, 150, 20)];
          _titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(5, 5, 300, 50)];
        [_titleLabel setBackgroundColor:[UIColor clearColor]];
//        _summaryLabel = [[UILabel alloc] initWithFrame:CGRectMake(5, 100, 300, 20)];
//        _titleLabel.lineBreakMode = NSLineBreakByWordWrapping;
//        _titleLabel.numberOfLines = 0;
       _posttimeLabel = [[UILabel alloc] initWithFrame:CGRectMake(winsize.width-200, 50, 200, 20)];
        [_posttimeLabel setBackgroundColor:[UIColor clearColor]];
//        _readCountLabel = [[UILabel alloc] initWithFrame:CGRectMake(210, 120, 100, 20)];
//        _postUserLabel = [[UILabel alloc] initWithFrame:CGRectMake(5, 140, 150, 20)];
//        _postUserNameLabel = [[UILabel alloc] initWithFrame:CGRectMake(160, 140, 150, 20)];
//        _cateIdLabel = [[UILabel alloc] initWithFrame:CGRectMake(5, 160, 150, 20)];
       
//        _cateNameLabel = [[UILabel alloc] initWithFrame:CGRectMake(160, 160, 150, 20)];
        
//        _authorLabel = [[UILabel alloc] initWithFrame:CGRectMake(5, 180, 150, 20)];
//        _sourceLabel = [[UILabel alloc] initWithFrame:CGRectMake(160, 180, 150, 20)];
        
//        [self.contentView addSubview:_newsIdLabel];
        [self.contentView addSubview:_titleLabel];
//        [self.contentView addSubview:_keywordsLabel];
//        [self.contentView addSubview:_summaryLabel];
       [self.contentView addSubview:_posttimeLabel];
//        [self.contentView addSubview:_readCountLabel];
//        [self.contentView addSubview:_postUserLabel];
//        [self.contentView addSubview:_postUserNameLabel];
//        [self.contentView addSubview:_cateIdLabel];
//        [self.contentView addSubview:_cateNameLabel];
//        [self.contentView addSubview:_authorLabel];
//        [self.contentView addSubview:_sourceLabel];
    }
    return self;
}

- (void)drawCell:(NSDictionary *)dic
{
//    _newsIdLabel.text = [NSString stringWithFormat:@"编号:%@",[dic objectForKey:@"newsId"]];
    _titleLabel.text = [NSString stringWithFormat:@"%@",[dic objectForKey:@"title"]];
//    _keywordsLabel.text = [NSString stringWithFormat:@"关键字:%@",[dic objectForKey:@"keywords"]];
//    _summaryLabel.text = [dic objectForKey:@"summary"];
    _posttimeLabel.text = [NSString stringWithFormat:@"%@",[dic objectForKey:@"posttime"]];
//    _readCountLabel.text = [NSString stringWithFormat:@"浏览次数:%@",[dic objectForKey:@"readCount"]];
//    _postUserLabel.text = [NSString stringWithFormat:@"发布用户:%@",[dic objectForKey:@"postUser"]];
//    _postUserNameLabel.text = [NSString stringWithFormat:@"发布用户名:%@",[dic objectForKey:@"postUserName"]];
//    _cateIdLabel.text = [NSString stringWithFormat:@"分类ID:%@",[dic objectForKey:@"cateId"]];
//    _cateNameLabel.text = [NSString stringWithFormat:@"分类名称:%@",[dic objectForKey:@"cateName"]];
//    _authorLabel.text = [NSString stringWithFormat:@"文章作者:%@",[dic objectForKey:@"author"]];
//    _sourceLabel.text = [NSString stringWithFormat:@"来源:%@",[dic objectForKey:@"source"]];
}

-(void)drawRect:(CGRect)rect
{
    
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
